package com.csnf.controller;


import com.csnf.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/storage")
public class StorageController {

    @Autowired
    StorageService storageService;

    //扣减库存
    @RequestMapping("/updateStorage")
    public String updateStorage(String productCode,int count){
        int r = storageService.updateStorage(productCode,count);
        if(r>0){
            return "success";
        }else{
            return "fail";
        }

    }


}
